<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./12-reactive-02-进一步优化桶结构.js"></script>
</head>
<body>
  <div id="app"></div>
  <script>
    // 1. 创建响应式变量
    const state1 = reactive({name: '孙悟空', age: 18})
    const state2 = reactive({name: '猪八戒', age: 33})
    // 2. 注册副作用函数
    effect(function effect1(){
      console.log('effect1执行....', state1.name)
    })

    effect(function effect2(){
      console.log('effect2执行....', state2.name)
    })
    setTimeout(() => {
      state1.name = "齐天大圣"
    }, 1000)
    console.log('bucket', bucket)
  </script>
</body>
</html>